'use strict'

/**
 * H5
 */
module.exports = app => {
  const { router, controller, middleware } = app
  const { jwtAuth } = middleware.auth
  const { config } = app
  const { screen } = controller

  const prefix = `/nj/screen`

  /**
   * 中间件
   */
  // router.use(`${prefix}`, middleware.requestLog()) // 请求日志
  router.use(`${prefix}`, middleware.api) //  Api请求拦截器(错误、异常)

  /**
   * 场所
   */
  router.get(`${prefix}/place/type/scan`, screen.place.placeTypeScan) // 场所分类扫码数据
  router.get(`${prefix}/place/type`, screen.place.placeType) // 场所分类
  router.get(`${prefix}/place/scan`, screen.place.placeScan) // 场所扫码数据
  router.get(`${prefix}/place/scan/age-group`, screen.place.placeScanAgeGroup) // 场所扫码年龄段

  /**
   * 核酸
   */
  router.get(`${prefix}/hs/result`, screen.hs.hsResult) // 核酸结果

  /**
   * 人员
   */
  router.get(`${prefix}/person/enter-trend`, screen.person.enterTrend) // 流入人员-趋势
  router.get(`${prefix}/person/enter`, screen.person.enterPerson) // 流入人员
  router.get(`${prefix}/person/positive`, screen.person.positivePerson) // 阳性人员
  router.get(`${prefix}/person/town`, screen.person.townPerson) // 乡镇人口
  router.get(`${prefix}/person/probably`, screen.person.probablyPerson) // 密接人员
  router.get(`${prefix}/person/from-city`, screen.person.fromCity) // 来源地
  router.get(`${prefix}/person/age-group`, screen.person.ageGroup) // 年龄段
  router.get(`${prefix}/person/special`, screen.person.specialPerson) // 特殊人群
  router.get(`${prefix}/person/type`, screen.person.personType) // 人员类

  /**
   * 页面
   */
  router.get(`${prefix}/page/home`, screen.page.home) // 态势总览
  router.get(`${prefix}/page/code`, screen.page.code) // 场所码管理
  router.get(`${prefix}/page/hs`, screen.page.hs) // 核酸检测
  router.get(`${prefix}/page/report`, screen.page.report) // 返乡报备

  /**
   * 地区
   */
  router.get(`${prefix}/district/scan`, screen.district.scan) // 地区-扫码数据
  router.get(`${prefix}/district/stat`, screen.district.stat) // 地区-统计
  router.get(`${prefix}/district/village`, screen.district.village) // 地区-村

  /**
   * 乡镇
   */
  router.get(`${prefix}/town/village`, screen.town.village) // 乡镇-村数量
  router.get(`${prefix}/town/scan`, screen.town.scan) // 乡镇-扫码数据
  router.get(`${prefix}/town/place-code`, screen.town.placeCode) // 乡镇-扫码数据
  router.get(`${prefix}/town/person-enter`, screen.town.personEnter) // 乡镇-人员流入
  router.get(`${prefix}/town/hs-collect`, screen.town.hsCollect) // 乡镇-核酸采集

  /**
   * 返乡报备
   */
  router.get(`${prefix}/report`, screen.report.report) // 返乡报备数据
  router.get(`${prefix}/report/early-warn`, screen.report.earlyWarn) // 返乡人员-预警
  router.get(`${prefix}/report/place-scan`, screen.report.hsyjPlaceScan) // 返乡人员-场所扫码
  router.get(`${prefix}/report/home-address`, screen.report.homeAddress) // 返乡人员-居住地

  /**
   * 风险
   */
  router.get(`${prefix}/risk/warn`, screen.risk.warn) // 风险-预警

  /**
   * 一键查查
   */
  router.get(`${prefix}/query/base-info`, screen.query.baseInfo) // 基本信息
  router.get(`${prefix}/query/hs-result`, screen.query.hsResult) // 核酸结果
  router.get(`${prefix}/query/probably`, screen.query.probably) // 密接
  router.get(`${prefix}/query/isolate`, screen.query.isolate) // 隔离
  router.get(`${prefix}/query/scan`, screen.query.scan) // 扫码
}
